Revision: tla--libawk-exp--1.3.1--patch-2
Archive: lord@emf.net--libawk-exp-2005
Creator: Thomas Lord <lord@emf.net>
Date: Fri Feb 11 12:41:16 PST 2005
Standard-date: 2005-02-11 20:41:16 GMT
Modified-files: libarch/pfs-ftp.c
New-patches: lord@emf.net--libawk-exp-2005/tla--libawk-exp--1.3.1--patch-2
Summary: remove pfs-ftp.c call to `trim_surrounding_ws'
Keywords: 

The function "libawk/trim.c(trim_surrounding_ws)" is problematic
in a library.

It presumes that it's argument is allocated by `lim_malloc' with
a `limits' parameter of 0.  It `lim_realloc'-s this argument.

Thus, the function is suitable only in a library which does not
attempt to permit graceful handling of allocation failures.  It's
caller's allocation habits are constrained and `trim_surrounding_ws'
itself will exit the process (via `panic') if allocation fails.

There are only a small number of uses of `trim_surrounding_ws' in
`libarch' and these fall into four or five equivalence classes.
Meaning: there are only four or five patterns of use fo
`trim_surrounding_ws' to modify in order to remove all dependencies on
`trim_surrounding_ws' and permit removal of "libawk/trim.[ch]".

One unique of of `trim_surrounding_ws' was in
"pfs-ftp.c(pfs_ftp_directory_files)" where it was used to remove
surrounding whitespace from `NLST' output before passing that output
to `rel_ws_split'.   

That use was entirely superfluous: `rel_ws_split' implicitly trims
whitespace from its argument.

This change simply removes the `#include' of "trim.h" from `pfs-ftp.c'
and deletes the call to `trim_surrounding_ws'.


